<template>
  <div>
    <Tb />
    <Torb />
    <Torc />
    <Plan />
    <Xunlian />
    <Tingshuo />
  </div>
</template>

<script>
import Tb from "@/components/danci/torbar.vue";
import Torb from "@/components/danci/torb.vue";
import Torc from "@/components/danci/torc.vue";
import Plan from "@/components/danci/plan.vue";
import Xunlian from "@/components/danci/xunlian.vue";
import Tingshuo from "@/components/danci/tingshuo.vue";
// import Tord  from "@/components/danci/tord.vue"
export default {
  components: {
    Tb,
    Torb,
    Torc,
    Plan,
    Xunlian,
    Tingshuo,
  },
  created() {
    this.$store.dispatch("getaxios", { url: "/data/list" });
  },
  computed: {
    newarr() {
      return this.$store.state.arr;
    },
  },
  // 进入组件得时候调用
  beforeRouteEnter(to, from, next) {
    console.log(to);
    console.log(from);
    next();
  },
  // 离开组件时候被调用
  beforeRouteLeave(to, from, next) {
    if (confirm("您确定要离开吗？")) {
      console.log(to);
      console.log(from);
      next();
    } else {
      next("/danci");
    }
  },
};
</script>

<style>
</style>